$(function(){
	var count = 0;
	var count2 = 0 ;
	var outer = $(".pc-box .outer");
	var outer2 = $(".wap-box .outer");
	var oneWidth=$(".pc-box .spic").eq(0).width();
	var oneWidth2=$(".wap-box .spic").eq(0).width();
	
	
	$(".pc-next").click(function(){ 
		if(count < 2 ){
			count++;
			moveCoord();
		}else{
			count = 0 ;
			outer.animate({
				"left":0
			});
		}
	})
	$(".pc-prev").click(function(){ 
		if(count != 0 ){
			count--;
			moveCoord();
		}
	});
	
	$(".pc-box .pc-zhezhao").click(function(){
		$(".show-big-img").fadeIn(300);
		moveCoord3();
	})
	$(".closebp").click(function(){
		$(".show-big-img").fadeOut(300);
	});
	$(".xcyou").click(function(){
		if(count < 2){
			count++;
			moveCoord3();
		}else{
			count = 0 ;
			$(".outer-bg-img").animate({
				"left":0
			});
		}
		
	});
	$(".xczuo").click(function(){
		if(count != 0){
			count--;
			moveCoord3();
		}
	})
	
	$(".wap-next").click(function(){ 
		if(count2 < 2 ){
			count2++;
			moveCoord2();
		}else{
			count2 = 0 ;
			outer2.animate({
				"left":0
			});
		}
	})
	$(".wap-prev").click(function(){ 
		if(count2 != 0 ){
			count2--;
			moveCoord2();
		}
	});
	
	$(".wap-box .pc-zhezhao").click(function(){
		$(".show-big-imgw").fadeIn(300);
		moveCoord4();
	})
	$(".closebpw").click(function(){
		$(".show-big-imgw").fadeOut(300);
	});
	
	$(".xcyouw").click(function(){
		if(count2 < 2){
			count2++;
			moveCoord4();
		}else{
			count2 = 0 ;
			$(".outer-bg-imgw").animate({
				"left":0
			});
		}
		
	});
	$(".xczuow").click(function(){
		if(count2 != 0){
			count2--;
			moveCoord4();
		}
	})
	
	
	function moveCoord(){
		outer.animate({
			"left":-(oneWidth*count+95.5*count)+"px"
		});
	}	
	
	function moveCoord2(){
		outer2.animate({
			"left":-(oneWidth2*count2+53.5*count2)+"px"
		});
	}	
	function moveCoord3(){
		$(".outer-bg-img").animate({
			"left":-(1920*count)+"px"
		});
	}
	function moveCoord4(){
		$(".outer-bg-imgw").animate({
			"left":-(1920*count2)+"px"
		});
	}
})
